import React from 'react'
import style from './style.module.scss'
import {useNavigate} from 'react-router-dom'
export default function MyHeader(props) {
    const navigate = useNavigate()
    //返回上一层地址路径
    function goBack(){
        navigate(-1)
    }
  return (
    <div className={style.header}>
          <span onClick={goBack} className='iconfont icon-fanhui'></span>  
          {/* <div className={style.title}>{props.title}</div> */}
          <div className={style.title}>
            {props.children}
          </div>
    </div>
  )
}

MyHeader.defaultProps={
    title:''
}
